import React, { useState, useEffect } from 'react'

export default function My() {
    const [name, setName] = useState('蒋皓天')


    useEffect(() => {
        console.log('名称发生变化')
    }, [name])

    function handleButtonClick() {
        setName('周钰')
    }

    return (
        <div>
            <h1>用户中心页面</h1>
            <div className="userCenter">
                <input type="text" onInput={(evt) => { setName(evt.target.value) }} />
                <button onClick={() => { handleButtonClick() }}>设置</button>
            </div>
        </div>
    )
}
